package com.study.reactor.utils;

import okhttp3.OkHttpClient;

import java.util.concurrent.TimeUnit;

/**
 * @author yuantongqin
 * desc:
 * 2020-11-09
 */
public class OkHttpUtil {


    public static OkHttpClient getOkHttpClient() {
        return OkHttpUtil.ResourceHolder.okHttpClient;
    }

    private static class ResourceHolder {
        private static OkHttpClient okHttpClient;

        private ResourceHolder() {
        }

        static {
            okHttpClient = (new OkHttpClient.Builder()).writeTimeout(90L, TimeUnit.SECONDS).readTimeout(90L, TimeUnit.SECONDS).build();
        }
    }
}
